﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Contact.aspx.cs"
    Inherits="RCREEE.Web.Contact" Culture="auto" meta:resourcekey="PageResource1"
    UICulture="auto" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="scriptMan" runat="server">
    </asp:ScriptManager>
    <div id="dialogContent" style="font-size: small">
        <p>
            Are you sure you want to delete?</p>
    </div>
    <asp:UpdateProgress ID="Up1" runat="Server" AssociatedUpdatePanelID="updatePanel1">
        <ProgressTemplate>
            <div class="progressBackgroundFilter">
            </div>
            <div class="processMessage">
                Loading...<br />
                <br />
                <img alt="Loading..." src="Images/Loading.gif" />
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="updatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Label ID="CheckEntityLabel" runat="server" Font-Bold="True" ForeColor="#CC0000"
                meta:resourcekey="CheckEntityLabelResource1"></asp:Label>
            <br />
            <table width="50%">
                <tr>
                    <td style="width: 25%">
                        <asp:Label ID="lblCountry" runat="server" Text="Country" meta:resourcekey="lblCountryResource1" />
                    </td>
                    <td style="width: 75%">
                        <asp:DropDownList ID="ddlCountries" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCountries_SelectedIndexChanged"
                            DataSourceID="odsCountries_All" DataTextField="CountryName" DataValueField="CountryId"
                            meta:resourcekey="ddlCountriesResource1" Width="100%">
                        </asp:DropDownList>
                    </td>
                </tr>
            </table>
            <br />
            <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="1">
                <asp:View ID="ContactView" runat="server" OnActivate="ContactView_Activate">
                    <div id="ContactDiv">
                        <div>
                            <br />
                            <table>
                                <tr>
                                    <td>
                                        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="MasterGridUpdatePanel">
                                            <ProgressTemplate>
                                                <div class="progressBackgroundFilter">
                                                </div>
                                                <div class="processMessage">
                                                    Loading...<br />
                                                    <br />
                                                    <img alt="Loading..." src="Images/Loading.gif" />
                                                </div>
                                            </ProgressTemplate>
                                        </asp:UpdateProgress>
                                        <asp:UpdatePanel ID="MasterGridUpdatePanel" runat="server" UpdateMode="Conditional">
                                            <ContentTemplate>
                                                <asp:GridView ID="gvMaster" runat="server" DataSourceID="MasterObjDataSource" EnableModelValidation="True"
                                                    CellPadding="4" ForeColor="#333333" GridLines="None" CssClass="style1" DataKeyNames="ContactId"
                                                    AutoGenerateColumns="False" meta:resourcekey="gvMasterResource1" Width="100%"
                                                    EmptyDataText="No Data Available for the current Language!">
                                                    <AlternatingRowStyle BackColor="White" />
                                                    <Columns>
                                                        <asp:TemplateField HeaderText="Name" meta:resourcekey="TemplateFieldResource1">
                                                            <ItemTemplate>
                                                                <asp:LinkButton ID="lnkname" runat="server" Text='<%# Eval("ContactName") %>' CommandName="Select"
                                                                    CommandArgument='<%# Eval("ContactId") %>' OnClick="Test1" meta:resourcekey="lnknameResource1"></asp:LinkButton>
                                                            </ItemTemplate>
                                                            <HeaderStyle Width="300px" />
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="ContactId" HeaderText="Entity Id" Visible="False" meta:resourcekey="BoundFieldResource1">
                                                            <HeaderStyle Width="100px" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="FieldName" HeaderText="Field" meta:resourcekey="BoundFieldResource2">
                                                            <HeaderStyle Width="200px" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="PhoneNumber" HeaderText="Phone Number" meta:resourcekey="BoundFieldResource3">
                                                            <HeaderStyle Width="200px" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="FaxNumber" HeaderText="Fax Number" meta:resourcekey="BoundFieldResource4">
                                                            <HeaderStyle Width="200px" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="Email" HeaderText="Email" meta:resourcekey="BoundFieldResource5">
                                                            <HeaderStyle Width="250px" />
                                                        </asp:BoundField>
                                                    </Columns>
                                                    <FooterStyle BackColor="#0268b0" Font-Bold="True" ForeColor="White" />
                                                    <HeaderStyle BackColor="#0268b0" Font-Bold="True" ForeColor="White" />
                                                    <PagerStyle BackColor="#CCCCCC" ForeColor="#990000" HorizontalAlign="Center" />
                                                    <RowStyle BackColor="#EAEAEA" ForeColor="#333333" />
                                                    <SelectedRowStyle BackColor="#CCCCCC" Font-Bold="True" ForeColor="#990000" />
                                                </asp:GridView>
                                            </ContentTemplate>
                                            <Triggers>
                                                <asp:PostBackTrigger ControlID="Button1" />
                                                <asp:AsyncPostBackTrigger ControlID="fvDetails" EventName="ModeChanged" />
                                            </Triggers>
                                        </asp:UpdatePanel>
                                        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Print" meta:resourcekey="Button1Resource1" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:UpdatePanel ID="updatePanelbtnAdd" runat="server" UpdateMode="Conditional">
                                            <ContentTemplate>
                                                <asp:LinkButton ID="btnAddNew" runat="server" Text="Add New" OnClick="btnAddNew_Click"
                                                    Style="float: right" meta:resourcekey="btnAddNewResource1"></asp:LinkButton>
                                            </ContentTemplate>
                                            <Triggers>
                                                <asp:AsyncPostBackTrigger ControlID="fvDetails" EventName="DataBound" />
                                            </Triggers>
                                        </asp:UpdatePanel>
                                    </td>
                                </tr>
                            </table>
                            <asp:ObjectDataSource ID="MasterObjDataSource" runat="server" SelectMethod="GetAllMasterContacts"
                                TypeName="RCREEE.Library.Entities.Contact" DataObjectTypeName="RCREEE.Library.Entities.Contact"
                                InsertMethod="InsertContact" UpdateMethod="UpdateContact">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="hiddenEntityId" DefaultValue="" Name="entityId"
                                        PropertyName="Value" Type="Int32" />
                                    <asp:SessionParameter DefaultValue="1033" Name="languageCode" SessionField="LanguageCode"
                                        Type="Int32" />
                                    <asp:ControlParameter ControlID="ddlCountries" Name="countryId" PropertyName="SelectedValue"
                                        Type="Int32" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                        </div>
                        <div>
                            <asp:ObjectDataSource ID="DetailsObjDataSource" runat="server" SelectMethod="GetOneContractById"
                                TypeName="RCREEE.Library.Entities.Contact" DataObjectTypeName="RCREEE.Library.Entities.Contact"
                                UpdateMethod="UpdateContact" InsertMethod="InsertContact" DeleteMethod="DeleteContact">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="gvMaster" Name="contactId" PropertyName="SelectedValue"
                                        Type="Int32" />
                                    <asp:SessionParameter Name="languageCode" SessionField="LanguageCode" Type="Int32"
                                        DefaultValue="1033" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:ObjectDataSource ID="odsAvailableContacts" runat="server" SelectMethod="GetAvailableParentContacts"
                                TypeName="RCREEE.Library.DataManager">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="hiddenCurrentContactId" DefaultValue="0" Name="CurrentContactId"
                                        PropertyName="Value" Type="Int32" />
                                    <asp:ControlParameter ControlID="hiddenParentCountryId" DefaultValue="0" Name="CountryId"
                                        PropertyName="Value" Type="Int32" />
                                    <asp:ControlParameter ControlID="hiddenParentEntityId" DefaultValue="0" Name="EntityId"
                                        PropertyName="Value" Type="Int32" />
                                    <asp:SessionParameter DefaultValue="1033" Name="LanguageCode" SessionField="LanguageCode"
                                        Type="Int32" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            <br />
                            <asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="langiageUodatePanel">
                                <ProgressTemplate>
                                    <div class="progressBackgroundFilter">
                                    </div>
                                    <div class="processMessage">
                                        Loading...<br />
                                        <br />
                                        <img alt="Loading..." src="Images/Loading.gif" />
                                    </div>
                                </ProgressTemplate>
                            </asp:UpdateProgress>
                            <asp:UpdatePanel ID="langiageUodatePanel" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <table width="100%">
                                        <tr>
                                            <td class="style2">
                                                <asp:Label ID="lblLanguage" runat="server" Text="Language" Visible="False" meta:resourcekey="lblLanguageResource1" />
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="ddlLanguage" runat="server" SelectedValue='<%# Bind("LanguageCode") %>'
                                                    OnSelectedIndexChanged="ddlLanguage_SelectedIndexChanged" AutoPostBack="True"
                                                    Visible="False" meta:resourcekey="ddlLanguageResource1">
                                                    <asp:ListItem Text="English" Value="1033" meta:resourcekey="ListItemResource1" Selected="True" />
                                                    <asp:ListItem Text="French" Value="1036" meta:resourcekey="ListItemResource2" />
                                                    <asp:ListItem Text="Arabic" Value="1025" meta:resourcekey="ListItemResource3" />
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                    </table>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="fvDetails" EventName="ModeChanged" />
                                    <asp:AsyncPostBackTrigger ControlID="btnAddNew" EventName="Click" />
                                </Triggers>
                            </asp:UpdatePanel>
                            <asp:UpdateProgress ID="UpdateProgress3" runat="server" AssociatedUpdatePanelID="formViewUpdatePanel">
                                <ProgressTemplate>
                                    <div class="progressBackgroundFilter">
                                    </div>
                                    <div class="processMessage">
                                        Loading...<br />
                                        <br />
                                        <img alt="Loading..." src="Images/Loading.gif" />
                                    </div>
                                </ProgressTemplate>
                            </asp:UpdateProgress>
                            <asp:UpdatePanel ID="formViewUpdatePanel" runat="server">
                                <ContentTemplate>
                                    <asp:FormView ID="fvDetails" runat="server" DataSourceID="DetailsObjDataSource" EnableModelValidation="True"
                                        AllowPaging="True" CellPadding="4" ForeColor="#333333" OnItemUpdated="fvDetails_ItemUpdated"
                                        DataKeyNames="ContactId,LanguageCode" OnItemInserting="fvDetails_ItemInserting"
                                        OnItemDeleting="fvDetails_ItemDeleting" OnItemDeleted="fvDetails_ItemDeleted"
                                        OnItemInserted="fvDetails_ItemInserted" OnLoad="fvDetails_Load" OnDataBound="fvDetails_DataBound"
                                        OnItemUpdating="fvDetails_ItemUpdating" Width="500px" OnModeChanging="fvDetails_ModeChanging"
                                        meta:resourcekey="fvDetailsResource1" OnModeChanged="fvDetails_ModeChanged" OnDataBinding="fvDetails_DataBinding">
                                        <FooterStyle BackColor="#0268b0" Font-Bold="True" ForeColor="White" />
                                        <HeaderStyle BackColor="#0268b0" Font-Bold="True" ForeColor="White" />
                                        <ItemTemplate>
                                            <asp:Panel ID="ItemPanel" runat="server" GroupingText="Details" meta:resourcekey="ItemPanelResource1">
                                                <table id="ItemTable" runat="server" width="500px">
                                                    <tr visible="False" runat="server">
                                                        <td width="100px" runat="server">
                                                            Entity Id
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label18" runat="server" Text='<%# Eval("ContactId") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr visible="False" runat="server">
                                                        <td width="100px" runat="server">
                                                            Parent Entity Id
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label10" runat="server" Text='<%# Bind("ParentContactId") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr visible="False" runat="server">
                                                        <td width="100px" runat="server">
                                                            LanguageCode
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label19" runat="server" Text='<%# Bind("LanguageCode") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="lblContactName" runat="server" Text="Name" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label15" runat="server" Text='<%# Bind("ContactName") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td colspan='2' runat="server">
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label11" runat="server" Text="Field" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label23" runat="server" Text='<%# Bind("FieldName") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td colspan='2' runat="server">
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label17" runat="server" Text="Phone Number" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label6" runat="server" Text='<%# Bind("PhoneNumber") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label24" runat="server" Text="Fax Number" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label2" runat="server" Text='<%# Bind("FaxNumber") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label25" runat="server" Text="Mobile Number" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label7" runat="server" Text='<%# Bind("MobileNumber") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label26" runat="server" Text="Email" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label3" runat="server" Text='<%# Bind("Email") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label27" runat="server" Text="Website" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label8" runat="server" Text='<%# Bind("Website") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label28" runat="server" Text="Address" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label14" runat="server" Text='<%# Bind("Address") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td colspan='2' runat="server">
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label29" runat="server" Text="Experience" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label12" runat="server" Text='<%# Bind("Experience") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td colspan='2' runat="server">
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label30" runat="server" Text="Parent Entity" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="lblParentEntity" runat="server" Text='<%# Bind("ParentContactEntityName") %>'></asp:Label>
                                                            :
                                                            <asp:LinkButton ID="lnkname" runat="server" Text='<%# Bind("ParentContactName") %>'
                                                                PostBackUrl='<%# String.Format("~/Contact.aspx?E={0}&R={1}", Eval("ParentContactEntityId"), Eval("ParentContactId")) %>'></asp:LinkButton>
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td colspan='2' runat="server">
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label31" runat="server" Text="Description" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label9" runat="server" Text='<%# Bind("Description") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td colspan='2' runat="server">
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label32" runat="server" Text="Qualification" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label5" runat="server" Text='<%# Bind("Qualification") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td colspan='2' runat="server">
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr visible="False" runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label33" runat="server" Text="Country" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label4" runat="server" Text='<%# Bind("CountryName") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr visible="False" runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label34" runat="server" Text="Category" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label1" runat="server" Text='<%# Bind("EntityName") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr visible="False" runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label35" runat="server" Text="Qualification Level" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label20" runat="server" Text='<%# Bind("QualificationLevelName") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr visible="False" runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label36" runat="server" Text="Qualification Field" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label21" runat="server" Text='<%# Bind("QualificationFieldName") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr visible="False" runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label37" runat="server" Text="Qualification Sub-Field" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label22" runat="server" Text='<%# Bind("QualificationSubFieldName") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label38" runat="server" Text="Renewable Energy" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:CheckBox ID="chkIsRE" runat="server" Checked='<%# Bind("IsRE") %>' Enabled="False">
                                                            </asp:CheckBox>
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label39" runat="server" Text="Energy Efficiency" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:CheckBox ID="chkIsEE" runat="server" Checked='<%# Bind("IsEE") %>' Enabled="False">
                                                            </asp:CheckBox>
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label40" runat="server" Text="Number Of Experts" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label13" runat="server" Text='<%# Bind("NumberOfExperts") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="Label41" runat="server" Text="Job Description" />
                                                        </td>
                                                        <td width="100px" runat="server">
                                                            <asp:Label ID="label16" runat="server" Text='<%# Bind("JobDescription") %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr runat="server">
                                                        <td colspan='2' runat="server">
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                </table>
                                                <table>
                                                    <tr>
                                                        <td>
                                                            <asp:Label ID="Label42" runat="server" Text="Related Entities:" meta:resourcekey="Label42Resource1" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:GridView ID="gvRelatedContacts" runat="server" AllowPaging="True" EnableModelValidation="True"
                                                                CellPadding="4" ForeColor="#333333" GridLines="None" CssClass="style1" DataKeyNames="ContactId"
                                                                AutoGenerateColumns="False" meta:resourcekey="gvRelatedContactsResource1" Width="100%">
                                                                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                                                <Columns>
                                                                    <asp:TemplateField HeaderText="Name" meta:resourcekey="TemplateFieldResource1">
                                                                        <ItemTemplate>
                                                                            <a href='<%# "Contact.aspx?E=" + Eval("EntityId")  + "&R=" + Eval("ContactId") %>'
                                                                                target="_blank" meta:resourcekey="lnknameResource1">
                                                                                <%# Eval("ContactName") %>
                                                                            </a>
                                                                        </ItemTemplate>
                                                                        <HeaderStyle Width="300px" />
                                                                    </asp:TemplateField>
                                                                    <asp:BoundField DataField="ContactId" HeaderText="Entity Id" Visible="False" meta:resourcekey="BoundFieldResource1">
                                                                        <HeaderStyle Width="100px" />
                                                                    </asp:BoundField>
                                                                    <asp:BoundField DataField="FieldName" HeaderText="Field" meta:resourcekey="BoundFieldResource2">
                                                                        <HeaderStyle Width="200px" />
                                                                    </asp:BoundField>
                                                                    <asp:BoundField DataField="PhoneNumber" HeaderText="Phone Number" meta:resourcekey="BoundFieldResource3">
                                                                        <HeaderStyle Width="200px" />
                                                                    </asp:BoundField>
                                                                    <asp:BoundField DataField="FaxNumber" HeaderText="Fax Number" meta:resourcekey="BoundFieldResource4">
                                                                        <HeaderStyle Width="200px" />
                                                                    </asp:BoundField>
                                                                    <asp:BoundField DataField="Email" HeaderText="Email" meta:resourcekey="BoundFieldResource5">
                                                                        <HeaderStyle Width="250px" />
                                                                    </asp:BoundField>
                                                                </Columns>
                                                                <FooterStyle BackColor="#0268b0" Font-Bold="True" ForeColor="White" />
                                                                <HeaderStyle BackColor="#0268b0" Font-Bold="True" ForeColor="White" />
                                                                <PagerStyle BackColor="#CCCCCC" ForeColor="#990000" HorizontalAlign="Center" />
                                                                <RowStyle BackColor="#EAEAEA" ForeColor="#333333" />
                                                                <SelectedRowStyle BackColor="#CCCCCC" Font-Bold="True" ForeColor="#990000" />
                                                            </asp:GridView>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:Label ID="Label43" runat="server" Text="Related Projects" meta:resourcekey="Label43Resource1" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:GridView ID="gvRelatedProjects" runat="server" DataKeyNames="ProjectId" AutoGenerateColumns="False"
                                                                Width="565px" CellPadding="4" EnableModelValidation="True" ForeColor="#333333"
                                                                GridLines="None" AllowPaging="True" PageSize="5" meta:resourcekey="gvRelatedProjectsResource1">
                                                                <AlternatingRowStyle BackColor="White" />
                                                                <Columns>
                                                                    <asp:BoundField DataField="ProjectId" HeaderText="ProjectId" Visible="False" meta:resourcekey="BoundFieldResource15" />
                                                                    <asp:ButtonField CommandName="Select" DataTextField="Name" HeaderText="Project Name"
                                                                        Text="Project Name" meta:resourcekey="ButtonFieldResource1">
                                                                        <ItemStyle ForeColor="Blue" />
                                                                    </asp:ButtonField>
                                                                    <asp:BoundField DataField="ProjectType" HeaderText="Project Type" meta:resourcekey="BoundFieldResource16" />
                                                                    <asp:BoundField HeaderText="Place" DataField="Place" meta:resourcekey="BoundFieldResource17" />
                                                                    <asp:BoundField HeaderText="Operation Year" DataField="OperationYear" meta:resourcekey="BoundFieldResource18" />
                                                                    <asp:BoundField DataField="ExecutingAgency" HeaderText="Executing Agency" meta:resourcekey="BoundFieldResource19" />
                                                                </Columns>
                                                                <FooterStyle BackColor="#0268b0" Font-Bold="True" ForeColor="White" />
                                                                <HeaderStyle BackColor="#0268b0" Font-Bold="True" ForeColor="White" />
                                                                <PagerStyle BackColor="#CCCCCC" ForeColor="#990000" HorizontalAlign="Center" />
                                                                <RowStyle BackColor="#EAEAEA" ForeColor="#333333" />
                                                                <SelectedRowStyle BackColor="#CCCCCC" Font-Bold="True" ForeColor="#990000" />
                                                            </asp:GridView>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                </table>
                                                <asp:Button ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit"
                                                    Text="Edit" meta:resourcekey="EditButtonResource1"></asp:Button>
                                                <asp:Button ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete"
                                                    Text="Delete" OnClientClick="javascript:return openDeletePopup(this.name);" meta:resourcekey="DeleteButtonResource1">
                                                </asp:Button>
                                                <asp:Button ID="NewButton" runat="server" CausesValidation="False" CommandName="New"
                                                    Text="New" meta:resourcekey="NewButtonResource1"></asp:Button>
                                            </asp:Panel>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:Panel ID="EditPanel" runat="server" GroupingText=" Modify Details" meta:resourcekey="EditPanelResource1">
                                                <asp:Label ID="lblLanguageCode" runat="server" Text='<%# Bind("LanguageCode") %>'
                                                    Visible="False" meta:resourcekey="lblLanguageCodeResource1" />
                                                <asp:Label ID="lblContactId" runat="server" Text='<%# Bind("ContactId") %>' Visible="False"
                                                    meta:resourcekey="lblContactIdResource1"></asp:Label>
                                                <br />
                                                <table width="500px">
                                                    <tr>
                                                        <td width="100px">
                                                            <asp:Label ID="Label17" runat="server" Text="Name:" meta:resourcekey="Label17Resource1" />
                                                        </td>
                                                        <td width="100px">
                                                            <asp:TextBox ID="txtEditName" runat="server" Text='<%# Bind("ContactName") %>' Width="200px"
                                                                meta:resourcekey="txtEditNameResource1"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="vldNameEdit" runat="server" ControlToValidate="txtEditName"
                                                                ErrorMessage="Entity name" meta:resourcekey="vldNameEditResource1" Text="*"></asp:RequiredFieldValidator>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan='2'>
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="100px">
                                                            <asp:Label ID="Label44" runat="server" Text="Country:" meta:resourcekey="Label44Resource1" />
                                                        </td>
                                                        <td width="100px">
                                                            <asp:DropDownList ID="ddlCountries" runat="server" DataSourceID="CountriesObjectDataSource"
                                                                DataValueField="CountryId" DataTextField="CountryName" SelectedValue='<%# Bind("CountryId") %>'
                                                                Width="200px" meta:resourcekey="ddlCountriesResource2">
                                                            </asp:DropDownList>
                                                            <asp:CompareValidator ID="vldCountryEdit" runat="server" ControlToValidate="ddlCountries"
                                                                ErrorMessage="Country" Operator="NotEqual" Type="Integer" ValueToCompare="0"
                                                                meta:resourcekey="vldCountryEditResource1" Text="*"></asp:CompareValidator>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="100px">
                                                            <asp:Label ID="Label45" runat="server" Text="Category:" meta:resourcekey="Label45Resource1" />
                                                        </td>
                                                        <td width="100px">
                                                            <asp:DropDownList ID="ddlEntities" runat="server" DataSourceID="odsEntities" DataValueField="ID"
                                                                DataTextField="Name" SelectedValue='<%# Bind("EntityId") %>' Width="200px" meta:resourcekey="ddlEntitiesResource1">
                                                            </asp:DropDownList>
                                                            <asp:CompareValidator ID="vldEntityEdit" runat="server" ControlToValidate="ddlEntities"
                                                                ErrorMessage="Category" Operator="NotEqual" Type="Integer" ValueToCompare="0"
                                                                meta:resourcekey="vldEntityEditResource1" Text="*"></asp:CompareValidator>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan='2'>
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="100px">
                                                            <asp:Label ID="Label46" runat="server" Text="Field:" meta:resourcekey="Label46Resource1" />
                                                        </td>
                                                        <td width="100px">
                                                            <asp:DropDownList ID="ddlFieldEdit" runat="server" DataSourceID="odsFields" DataTextField="ItemName"
                                                                DataValueField="ItemId" SelectedValue='<%# Bind("FieldId") %>' Width="200px"
                                                                meta:resourcekey="ddlFieldEditResource1">
                                                            </asp:DropDownList>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2">
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="100px">
                                                            <asp:Label ID="Label47" runat="server" Text="Phone Number:" meta:resourcekey="Label47Resource1" />
                                                        </td>
                                                        <td width="100px">
                                                            <asp:TextBox ID="txtPhoneNumber_Edit" runat="server" Text='<%# Bind("PhoneNumber") %>'
                                                                Width="200px" meta:resourcekey="txtPhoneNumber_EditResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="100px">
                                                            <asp:Label ID="Label48" runat="server" Text="Mobile Number:" meta:resourcekey="Label48Resource1" />
                                                        </td>
                                                        <td width="100px">
                                                            <asp:TextBox ID="txtMobileNumber_Edit" runat="server" Text='<%# Bind("MobileNumber") %>'
                                                                Width="200px" meta:resourcekey="txtMobileNumber_EditResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="100px">
                                                            <asp:Label ID="Label49" runat="server" Text="Fax Number:" meta:resourcekey="Label49Resource1" />
                                                        </td>
                                                        <td width="100px">
                                                            <asp:TextBox ID="txtFaxNumber_Edit" runat="server" Text='<%# Bind("FaxNumber") %>'
                                                                Width="200px" meta:resourcekey="txtFaxNumber_EditResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="100px">
                                                            <asp:Label ID="Label50" runat="server" Text="Email:" meta:resourcekey="Label50Resource1" />
                                                        </td>
                                                        <td width="100px">
                                                            <asp:TextBox ID="txtEmail_Edit" runat="server" Text='<%# Bind("Email") %>' Width="200px"
                                                                meta:resourcekey="txtEmail_EditResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="100px">
                                                            <asp:Label ID="Label51" runat="server" Text="Website:" meta:resourcekey="Label51Resource1" />
                                                        </td>
                                                        <td width="100px">
                                                            <asp:TextBox ID="txtWebsite_Edit" runat="server" Text='<%# Bind("Website") %>' Width="200px"
                                                                meta:resourcekey="txtWebsite_EditResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2">
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2">
                                                            <panel>
                                                        <table>
                                                        <tr>
                                                        <td colspan = '3'>
                                                        <asp:Label ID="Label52" runat="server" Text ="Qualification:" 
                                                                meta:resourcekey="Label52Resource1" />
                                                        </td>
                                                        </tr>
                                                            <tr>
                                                                <td>
                                                                    <asp:Label ID="Label53" runat="server" Text ="Level" 
                                                                        meta:resourcekey="Label53Resource1" />
                                                                    </td>
                                                                <td>
                                                                    <asp:Label ID="Label54" runat="server" Text ="Field" 
                                                                        meta:resourcekey="Label54Resource1" />
                                                                    </td>
                                                                <td>
                                                                    <asp:Label ID="Label55" runat="server" Text ="Specialization" 
                                                                        meta:resourcekey="Label55Resource1" />
                                                                    </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    <asp:DropDownList ID="ddlQualificationLevelEdit" runat="server" 
                                                                        DataSourceID="odsQualificationLevels" DataTextField="ItemName" 
                                                                        DataValueField="ItemId" 
                                                                        SelectedValue='<%# Bind("QualificationLevelId") %>' 
                                                                        meta:resourcekey="ddlQualificationLevelEditResource1">
                                                                    </asp:DropDownList>
                                                                </td>
                                                                <td>
                                                                    <asp:DropDownList ID="ddlQualificationFieldEdit" runat="server" 
                                                                        DataSourceID="odsQualificationFields" DataTextField="ItemName" 
                                                                        DataValueField="ItemId" 
                                                                        SelectedValue='<%# Bind("QualificationFieldId") %>' 
                                                                        meta:resourcekey="ddlQualificationFieldEditResource1">
                                                                    </asp:DropDownList>
                                                                </td>
                                                                <td>
                                                                    <asp:DropDownList ID="ddlQualificationSubFieldEdit" runat="server" 
                                                                        DataSourceID="odsQualificationSubFields" DataTextField="ItemName" 
                                                                        DataValueField="ItemId" 
                                                                        SelectedValue='<%# Bind("QualificationSubFieldId") %>' 
                                                                        meta:resourcekey="ddlQualificationSubFieldEditResource1">
                                                                    </asp:DropDownList>
                                                                </td>
                                                            </tr>
                                                        </table>   
                                                        </panel>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan='2'>
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan='2'>
                                                            <asp:CheckBox ID="chkIsRE_Edit" runat="server" Checked='<%# Bind("IsRE") %>' Text="Renewable Energy"
                                                                meta:resourcekey="chkIsRE_EditResource1"></asp:CheckBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan='2'>
                                                            <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("IsEE") %>' Text="Energy Efficiency:"
                                                                meta:resourcekey="CheckBox1Resource1"></asp:CheckBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan='2'>
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:Label ID="Label56" runat="server" Text="Description:" meta:resourcekey="Label56Resource1" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtDescription_Edit" runat="server" Text='<%# Bind("Description") %>'
                                                                Height="50px" TextMode="MultiLine" Width="200px" meta:resourcekey="txtDescription_EditResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:Label ID="Label57" runat="server" Text="Experience:" meta:resourcekey="Label57Resource1" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtExperience_Edit" runat="server" Text='<%# Bind("Experience") %>'
                                                                Width="200px" meta:resourcekey="txtExperience_EditResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:Label ID="Label58" runat="server" Text="Number Of Experts:" meta:resourcekey="Label58Resource1" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtNumberOfExperts_Edit" runat="server" Text='<%# Bind("NumberOfExperts") %>'
                                                                Width="200px" meta:resourcekey="txtNumberOfExperts_EditResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:Label ID="Label59" runat="server" Text="Address:" meta:resourcekey="Label59Resource1" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtAddress_Edit" runat="server" Text='<%# Bind("Address") %>' Height="50px"
                                                                TextMode="MultiLine" Width="200px" meta:resourcekey="txtAddress_EditResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:Label ID="Label60" runat="server" Text="Job Description:" meta:resourcekey="Label60Resource1" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtAffiliate_Edit" runat="server" Text='<%# Bind("JobDescription") %>'
                                                                Width="200px" meta:resourcekey="txtAffiliate_EditResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan='2'>
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2">
                                                            <panel>
                                                        <table>
                                                        <tr>
                                                        <td colspan = '3'>
                                                        <asp:Label ID="Label61" runat="server" Text ="Parent:" 
                                                                meta:resourcekey="Label61Resource1" />
                                                        </td>
                                                        </tr>
                                                            <tr>
                                                                <td class="style3">
                                                                    <asp:Label ID="Label62" runat="server" Text ="Country" 
                                                                        meta:resourcekey="Label62Resource1" />
                                                                    </td>
                                                                <td>
                                                                    <asp:Label ID="Label63" runat="server" Text ="Category" 
                                                                        meta:resourcekey="Label63Resource1" />
                                                                    </td>
                                                                <td>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="style3">
                                                                    <asp:DropDownList ID="ddlParentContactCountry" runat="server" DataSourceID="CountriesObjectDataSource"
                                            DataValueField="CountryId" DataTextField="CountryName" OnSelectedIndexChanged="ddlParentContactCountry_SelectedIndexChanged"
                                            AutoPostBack="True" meta:resourcekey="ddlParentContactCountryResource1">
                                        </asp:DropDownList>
                                                                </td>
                                                                <td>
                                                                   <asp:DropDownList ID="ddlParentContactEntity" runat="server" DataSourceID="odsEntities"
                                            DataValueField="ID" DataTextField="Name" AutoPostBack="True" 
                                                                        OnSelectedIndexChanged="ddlParentContactEntity_SelectedIndexChanged" 
                                                                        meta:resourcekey="ddlParentContactEntityResource1">
                                        </asp:DropDownList>
                                                                </td>
                                                                <td>
                                                                 <asp:UpdateProgress ID="UpdateProgress3" runat="server" 
                                                                        AssociatedUpdatePanelID="ParentContactUpdatePanel">
                                <ProgressTemplate>
                                    <div class="progressBackgroundFilter">
                                    </div>
                                    <div class="processMessage">
                                        Loading...<br />
                                        <br />
                                        <img alt="Loading..." src="Images/Loading.gif" />
                                    </div>
                                </ProgressTemplate>
                                </asp:UpdateProgress>
                                              <asp:UpdatePanel ID="ParentContactUpdatePanel" runat="server" UpdateMode="Conditional"
                                            ChildrenAsTriggers="False">
                                            <ContentTemplate>
                                                <asp:DropDownList ID="ddlParentContact" runat="server" DataSourceID="odsAvailableContacts"
                                                    DataValueField="ID" DataTextField="Name" 
                                                    meta:resourcekey="ddlParentContactResource1">
                                                </asp:DropDownList>
                                                <asp:Label ID="hiddenLabelParentContactID" runat="server" Text='<%# Bind("ParentContactId") %>'
                                                    Visible="False" meta:resourcekey="hiddenLabelParentContactIDResource1" />
                                            </ContentTemplate>
                                            <Triggers>
                                                <asp:AsyncPostBackTrigger ControlID="ddlParentContactCountry" EventName="SelectedIndexChanged" />
                                                <asp:AsyncPostBackTrigger ControlID="ddlParentContactEntity" EventName="SelectedIndexChanged" />
                                            </Triggers>
                                        </asp:UpdatePanel>
                                                                </td>
                                                            </tr>
                                                        </table> 
                                                        <panel>
                                                         <asp:Label ID="lblHiddenParentContactCountryId" runat="server" Text='<%# Bind("ParentContactCountryId") %>'
                                            Visible="False" meta:resourcekey="lblHiddenParentContactCountryIdResource1" />
                                        <asp:Label ID="lblHiddenParentContactEntityId" runat="server" Text='<%# Bind("ParentContactEntityId") %>'
                                            Visible="False" meta:resourcekey="lblHiddenParentContactEntityIdResource1" />
                                            </panel>  
                                                        </panel>
                                                        </td>
                                                    </tr>
                                                </table>
                                                <asp:LinkButton ID="UpdateButton" runat="server" CommandName="Update" Text="Update"
                                                    meta:resourcekey="UpdateButtonResource1"></asp:LinkButton>
                                                <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                                                    Text="Cancel" meta:resourcekey="UpdateCancelButtonResource1"></asp:LinkButton>
                                            </asp:Panel>
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <asp:Panel ID="InsertPanel" runat="server" GroupingText="New Entity details" meta:resourcekey="InsertPanelResource1">
                                                <asp:Label ID="lblLanguageCode" runat="server" Text='<%# Bind("LanguageCode") %>'
                                                    Visible="False" meta:resourcekey="lblLanguageCodeResource2" />
                                                <table width="500px">
                                                    <tr>
                                                        <td width="100px">
                                                            <asp:Label ID="Label46" runat="server" Text="Name:" meta:resourcekey="Label46Resource2" />
                                                        </td>
                                                        <td width="100px">
                                                            <asp:TextBox ID="txtContactName_Insert" runat="server" Text='<%# Bind("ContactName") %>'
                                                                Width="200px" meta:resourcekey="txtContactName_InsertResource1"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="vldContactName_Insert" runat="server" ControlToValidate="txtContactName_Insert"
                                                                ErrorMessage="Entity Name" meta:resourcekey="vldContactName_InsertResource1"
                                                                Text="*"></asp:RequiredFieldValidator>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan='2'>
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="100px">
                                                            <asp:Label ID="Label64" runat="server" Text="Country:" meta:resourcekey="Label64Resource1" />
                                                        </td>
                                                        <td width="100px">
                                                            <asp:DropDownList ID="ddlCountries" runat="server" DataSourceID="CountriesObjectDataSource"
                                                                DataValueField="CountryId" DataTextField="CountryName" SelectedValue='<%# Bind("CountryId") %>'
                                                                Width="200px" meta:resourcekey="ddlCountriesResource3">
                                                            </asp:DropDownList>
                                                            <asp:CompareValidator ID="vldCountry_Insert" runat="server" ControlToValidate="ddlCountries"
                                                                ErrorMessage="Country" Operator="NotEqual" ValueToCompare="0" meta:resourcekey="vldCountry_InsertResource1"
                                                                Text="*"></asp:CompareValidator>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="100px">
                                                            <asp:Label ID="Label65" runat="server" Text="Category:" meta:resourcekey="Label65Resource1" />
                                                        </td>
                                                        <td width="100px">
                                                            <asp:DropDownList ID="ddlEntities" runat="server" DataSourceID="odsEntities" DataValueField="ID"
                                                                DataTextField="Name" SelectedValue='<%# Bind("EntityId") %>' Width="200px" meta:resourcekey="ddlEntitiesResource2">
                                                            </asp:DropDownList>
                                                            <asp:CompareValidator ID="vldEntity_Insert" runat="server" ControlToValidate="ddlEntities"
                                                                ErrorMessage="Category" Operator="NotEqual" Type="Integer" ValueToCompare="0"
                                                                meta:resourcekey="vldEntity_InsertResource1" Text="*"></asp:CompareValidator>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan='2'>
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="100px">
                                                            <asp:Label ID="Label66" runat="server" Text="Field:" meta:resourcekey="Label66Resource1" />
                                                        </td>
                                                        <td>
                                                            <asp:DropDownList ID="ddlFieldInsert" runat="server" DataSourceID="odsFields" DataValueField="ItemId"
                                                                DataTextField="ItemName" SelectedValue='<%# Bind("FieldId") %>' meta:resourcekey="ddlFieldInsertResource1">
                                                            </asp:DropDownList>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2">
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="100px">
                                                            <asp:Label ID="Label67" runat="server" Text="Phone Number:" meta:resourcekey="Label67Resource1" />
                                                        </td>
                                                        <td width="100px">
                                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("PhoneNumber") %>' Width="200px"
                                                                meta:resourcekey="TextBox1Resource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="100px">
                                                            <asp:Label ID="Label68" runat="server" Text="Mobile Number:" meta:resourcekey="Label68Resource1" />
                                                        </td>
                                                        <td width="100px">
                                                            <asp:TextBox ID="txtMobileNumber_Insert" runat="server" Text='<%# Bind("MobileNumber") %>'
                                                                Width="200px" meta:resourcekey="txtMobileNumber_InsertResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="100px">
                                                            <asp:Label ID="Label69" runat="server" Text="Fax Number:" meta:resourcekey="Label69Resource1" />
                                                        </td>
                                                        <td width="100px">
                                                            <asp:TextBox ID="txtFaxNumber_Insert" runat="server" Text='<%# Bind("FaxNumber") %>'
                                                                Width="200px" meta:resourcekey="txtFaxNumber_InsertResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="100px">
                                                            <asp:Label ID="Label70" runat="server" Text="Email:" meta:resourcekey="Label70Resource1" />
                                                        </td>
                                                        <td width="100px">
                                                            <asp:TextBox ID="txtEmail_Insert" runat="server" Text='<%# Bind("Email") %>' Width="200px"
                                                                meta:resourcekey="txtEmail_InsertResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="100px">
                                                            <asp:Label ID="Label71" runat="server" Text="Website:" meta:resourcekey="Label71Resource1" />
                                                        </td>
                                                        <td width="100px">
                                                            <asp:TextBox ID="txtWebsite_Insert" runat="server" Text='<%# Bind("Website") %>'
                                                                Width="200px" meta:resourcekey="txtWebsite_InsertResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2">
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2">
                                                            <panel>
                         <table>
                         <tr>
                         <td colspan = '3'>
                         <asp:Label ID="Label72" runat="server" Text ="Qualification:" 
                                 meta:resourcekey="Label72Resource1" />
                         </td>
                         </tr>
                             <tr>
                                 <td>
                                     <asp:Label ID="Label73" runat="server" Text ="Level" 
                                         meta:resourcekey="Label73Resource1" /></td>
                                 <td>
                                     <asp:Label ID="Label74" runat="server" Text ="Field" 
                                         meta:resourcekey="Label74Resource1" /></td>
                                 <td>
                                     <asp:Label ID="Label75" runat="server" Text ="Specialization" 
                                         meta:resourcekey="Label75Resource1" /></td>
                             </tr>
                             <tr>
                                 <td>
                                     <asp:DropDownList ID="ddlQualificationLevelInsert" runat="server" 
                                         DataSourceID="odsQualificationLevels" DataTextField="ItemName" 
                                         DataValueField="ItemId" 
                                         SelectedValue='<%# Bind("QualificationLevelId") %>' 
                                         meta:resourcekey="ddlQualificationLevelInsertResource1">
                                     </asp:DropDownList>
                                 </td>
                                 <td>
                                     <asp:DropDownList ID="ddlQualificationFieldInsert" runat="server" 
                                         DataSourceID="odsQualificationFields" DataTextField="ItemName" 
                                         DataValueField="ItemId" 
                                         SelectedValue='<%# Bind("QualificationFieldId") %>' 
                                         meta:resourcekey="ddlQualificationFieldInsertResource1">
                                     </asp:DropDownList>
                                 </td>
                                 <td>
                                     <asp:DropDownList ID="ddlQualificationSubFieldInsert" runat="server" 
                                         DataSourceID="odsQualificationSubFields" DataTextField="ItemName" 
                                         DataValueField="ItemId" 
                                         SelectedValue='<%# Bind("QualificationSubFieldId") %>' 
                                         meta:resourcekey="ddlQualificationSubFieldInsertResource1">
                                     </asp:DropDownList>
                                 </td>
                             </tr>
                         </table>   
                         </panel>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan='2'>
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan='2'>
                                                            <asp:CheckBox ID="chkIsRE_Insert" runat="server" Checked='<%# Bind("IsRE") %>' Text="Renewable Energy"
                                                                meta:resourcekey="chkIsRE_InsertResource1"></asp:CheckBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan='2'>
                                                            <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("IsEE") %>' Text="Energy Efficiency:"
                                                                meta:resourcekey="CheckBox1Resource2"></asp:CheckBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan='2'>
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:Label ID="Label76" runat="server" Text="Description:" meta:resourcekey="Label76Resource1" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtDescription_Insert" runat="server" TextMode="MultiLine" Text='<%# Bind("Description") %>'
                                                                Height="50px" Width="200px" meta:resourcekey="txtDescription_InsertResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:Label ID="Label77" runat="server" Text="Experience:" meta:resourcekey="Label77Resource1" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtExperience_Insert" runat="server" Text='<%# Bind("Experience") %>'
                                                                Width="200px" meta:resourcekey="txtExperience_InsertResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:Label ID="Label78" runat="server" Text="Number Of Experts:" meta:resourcekey="Label78Resource1" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtNumberOfExperts_Insert" runat="server" Text='<%# Bind("NumberOfExperts") %>'
                                                                Height="18px" Width="200px" meta:resourcekey="txtNumberOfExperts_InsertResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:Label ID="Label79" runat="server" Text="Address:" meta:resourcekey="Label79Resource1" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtAddress_Insert" runat="server" Text='<%# Bind("Address") %>'
                                                                Height="50px" TextMode="MultiLine" Width="200px" meta:resourcekey="txtAddress_InsertResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:Label ID="Label80" runat="server" Text="Job Description:" meta:resourcekey="Label80Resource1" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtAffiliate_Insert" runat="server" Text='<%# Bind("JobDescription") %>'
                                                                Width="200px" meta:resourcekey="txtAffiliate_InsertResource1"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan='2'>
                                                            <hr />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2">
                                                            <panel>
                                                        <table>
                                                        <tr>
                                                        <td colspan = '3'>
                                                        <asp:Label ID="Label81" runat="server" Text ="Parent:" 
                                                                meta:resourcekey="Label81Resource1" />
                                                        </td>
                                                        </tr>
                                                            <tr>
                                                                <td class="style3">
                                                                    <asp:Label ID="Label82" runat="server" Text ="Country" 
                                                                        meta:resourcekey="Label82Resource1" /></td>
                                                                <td>
                                                                    <asp:Label ID="Label83" runat="server" Text ="Category" 
                                                                        meta:resourcekey="Label83Resource1" /></td>
                                                                <td>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="style3">
                                                                     <asp:DropDownList ID="ddlParentContactCountry_Insert" runat="server" DataSourceID="CountriesObjectDataSource"
                                            DataValueField="CountryId" DataTextField="CountryName" AutoPostBack="True" 
                                                                         OnSelectedIndexChanged="ddlParentContactCountry_Insert_SelectedIndexChanged" 
                                                                         meta:resourcekey="ddlParentContactCountry_InsertResource1">
                                        </asp:DropDownList>
                                                                </td>
                                                                <td>
                                                                   <asp:DropDownList ID="ddlParentContactEntity_Insert" runat="server" DataSourceID="odsEntities"
                                            DataValueField="ID" DataTextField="Name" AutoPostBack="True" 
                                                                        OnSelectedIndexChanged="ddlParentContactEntity_Insert_SelectedIndexChanged" 
                                                                        meta:resourcekey="ddlParentContactEntity_InsertResource1">
                                        </asp:DropDownList>
                                                                </td>
                                                                <td>
                              <asp:UpdateProgress ID="UpdateProgress3" runat="server" AssociatedUpdatePanelID="ParentContactUpdatePanel_Insert">
                                <ProgressTemplate>
                                    <div class="progressBackgroundFilter">
                                    </div>
                                    <div class="processMessage">
                                        Loading...<br />
                                        <br />
                                        <img alt="Loading..." src="Images/Loading.gif" />
                                    </div>
                                </ProgressTemplate>
                                </asp:UpdateProgress>
                                <asp:UpdatePanel ID="ParentContactUpdatePanel_Insert" runat="server" UpdateMode="Conditional"
                                            ChildrenAsTriggers="False">
                                            <ContentTemplate>
                                                <asp:DropDownList ID="ddlParentContact_Insert" runat="server" DataSourceID="odsAvailableContacts"
                                                    DataValueField="ID" DataTextField="Name" 
                                                    meta:resourcekey="ddlParentContact_InsertResource1">
                                                </asp:DropDownList>
                                            </ContentTemplate>
                                            <Triggers>
                                                <asp:AsyncPostBackTrigger ControlID="ddlParentContactCountry_Insert" EventName="SelectedIndexChanged" />
                                                <asp:AsyncPostBackTrigger ControlID="ddlParentContactEntity_Insert" EventName="SelectedIndexChanged" />
                                            </Triggers>
                                        </asp:UpdatePanel>
                                                                </td>
                                                            </tr>
                                                        </table> 
                                                        <panel>
                                                        </panel>
                                                        </td>
                                                    </tr>
                                                </table>
                                                <asp:LinkButton ID="InsertButton" runat="server" CommandName="Insert" Text="Insert"
                                                    meta:resourcekey="InsertButtonResource1"></asp:LinkButton>
                                                <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                                                    Text="Cancel" meta:resourcekey="InsertCancelButtonResource1"></asp:LinkButton>
                                            </asp:Panel>
                                        </InsertItemTemplate>
                                        <PagerStyle BackColor="#CCCCCC" ForeColor="#990000" HorizontalAlign="Center" />
                                        <RowStyle BackColor="#EAEAEA" ForeColor="#333333" />
                                    </asp:FormView>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="ddlLanguage" EventName="SelectedIndexChanged" />
                                </Triggers>
                            </asp:UpdatePanel>
                            <asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="Please, provide valid data for the following:"
                                meta:resourcekey="ValidationSummary1Resource1" />
                            <br />
                            <asp:ObjectDataSource ID="ItemsObjectDataSource" runat="server" SelectMethod="GetAllItems"
                                TypeName="RCREEE.Library.DataManager">
                                <SelectParameters>
                                    <asp:SessionParameter DefaultValue="1033" Name="LanguageCode" SessionField="LanguageCode"
                                        Type="Int32" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            <asp:ObjectDataSource ID="CountriesObjectDataSource" runat="server" SelectMethod="GetAllCountries"
                                TypeName="RCREEE.Library.DataManager">
                                <SelectParameters>
                                    <asp:SessionParameter DefaultValue="1033" Name="LanguageCode" SessionField="LanguageCode"
                                        Type="Int32" />
                                    <asp:Parameter DefaultValue="" Name="FirstItem" Type="String" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            <asp:ObjectDataSource ID="odsCountries_All" runat="server" SelectMethod="GetAllCountries"
                                TypeName="RCREEE.Library.DataManager">
                                <SelectParameters>
                                    <asp:SessionParameter DefaultValue="1033" Name="LanguageCode" SessionField="LanguageCode"
                                        Type="Int32" />
                                    <asp:Parameter DefaultValue="All" Name="FirstItem" Type="String" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            <asp:ObjectDataSource ID="odsEntities" runat="server" SelectMethod="GetEntitiesByEntityTypeIdForDDL"
                                TypeName="RCREEE.Library.DataManager">
                                <SelectParameters>
                                    <asp:Parameter DefaultValue="121" Name="EntityTypeId" Type="Int32" />
                                    <asp:SessionParameter DefaultValue="1033" Name="LanguageCode" SessionField="LanguageCode"
                                        Type="Int32" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            <asp:ObjectDataSource ID="odsFields" runat="server" SelectMethod="GetAllCategoryItems"
                                TypeName="RCREEE.Web.Contact">
                                <SelectParameters>
                                    <asp:Parameter DefaultValue="8" Name="CategoryId" Type="Int32" />
                                    <asp:QueryStringParameter QueryStringField="e" Name="paramParentItemId" Type="String" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            <asp:ObjectDataSource ID="odsQualificationLevels" runat="server" SelectMethod="GetAllCategoryItems"
                                TypeName="RCREEE.Web.Contact">
                                <SelectParameters>
                                    <asp:Parameter DefaultValue="5" Name="CategoryId" Type="Int32" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            <asp:ObjectDataSource ID="odsQualificationFields" runat="server" SelectMethod="GetAllCategoryItems"
                                TypeName="RCREEE.Web.Contact">
                                <SelectParameters>
                                    <asp:Parameter DefaultValue="6" Name="CategoryId" Type="Int32" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            <asp:ObjectDataSource ID="odsQualificationSubFields" runat="server" SelectMethod="GetAllCategoryItems"
                                TypeName="RCREEE.Web.Contact">
                                <SelectParameters>
                                    <asp:Parameter DefaultValue="7" Name="CategoryId" Type="Int32" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            <br />
                        </div>
                    </div>
                </asp:View>
                <asp:View ID="AllContactsView" runat="server" OnActivate="AllContactsView_Activate">
                    <div id="AllContactsDiv">
                        <asp:Repeater ID="contactRepeater" runat="server" DataSourceID="RepeaterObjectDataSource"
                            OnItemDataBound="contactRepeater_ItemDataBound">
                            <ItemTemplate>
                                <asp:Label ID="label1" runat="server" Text='<%# Eval("CountryName") %>' meta:resourcekey="label1Resource1" />
                                <asp:HiddenField ID="hiddenCountryId" runat="server" Value='<%# Eval("CountryId") %>' />
                                <asp:GridView ID="gvMaster" runat="server" AllowPaging="True" EnableModelValidation="True"
                                    CellPadding="4" ForeColor="#333333" GridLines="None" CssClass="style1" DataKeyNames="ContactId"
                                    AutoGenerateColumns="False" EmptyDataText="No data available for this language!"
                                    meta:resourcekey="gvMasterResource2" Width="100%">
                                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                    <Columns>
                                        <asp:BoundField DataField="ContactName" HeaderText="Entity" meta:resourcekey="BoundFieldResource20">
                                            <HeaderStyle Width="300px" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="ContactId" HeaderText="Entity Id" Visible="False" meta:resourcekey="BoundFieldResource21" />
                                        <asp:BoundField DataField="FieldName" HeaderText="Field" meta:resourcekey="BoundFieldResource22">
                                            <HeaderStyle Width="200px" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="PhoneNumber" HeaderText="Phone Number" meta:resourcekey="BoundFieldResource23">
                                            <HeaderStyle Width="200px" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="FaxNumber" HeaderText="Fax Number" meta:resourcekey="BoundFieldResource24">
                                            <HeaderStyle Width="200px" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Email" HeaderText="Email" meta:resourcekey="BoundFieldResource25">
                                            <HeaderStyle Width="250px" />
                                        </asp:BoundField>
                                    </Columns>
                                    <FooterStyle BackColor="#0268b0" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="#0268b0" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#CCCCCC" ForeColor="#990000" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#EAEAEA" ForeColor="#333333" />
                                    <SelectedRowStyle BackColor="#CCCCCC" Font-Bold="True" ForeColor="#990000" />
                                </asp:GridView>
                            </ItemTemplate>
                            <SeparatorTemplate>
                                <hr style="color: #000000; font-weight: bold; font-size: 10px; font-style: normal;" />
                            </SeparatorTemplate>
                        </asp:Repeater>
                        <asp:ObjectDataSource ID="RepeaterObjectDataSource" runat="server" SelectMethod="GetContactCountries"
                            TypeName="RCREEE.Library.DataManager">
                            <SelectParameters>
                                <asp:SessionParameter DefaultValue="1033" Name="LanguageCode" SessionField="LanguageCode"
                                    Type="Int32" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                    </div>
                </asp:View>
            </asp:MultiView>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:HiddenField ID="hiddenEntityId" runat="server" />
    <asp:HiddenField ID="hiddenRecordId" runat="server" />
    <asp:HiddenField ID="hiddenParentCountryId" runat="server" Value="0" />
    <asp:HiddenField ID="hiddenParentEntityId" runat="server" Value="0" />
    <asp:HiddenField ID="hiddenCurrentContactId" runat="server" Value="0" />
</asp:Content>
<asp:Content ID="Content3" runat="server" ContentPlaceHolderID="head">
    <style type="text/css">
        .style1
        {
            width: 284px;
        }
        .style2
        {
            width: 95px;
        }
    </style>
    <script type="text/javascript">
        $().ready(function () {
            $('#dialogContent').dialog({
                autoOpen: false,
                modal: true,
                bgiframe: true,
                title: "Confirm Delete",
                width: 300,
                height: 200
            });
        });

        function openDeletePopup(uniqueID) {
            $('#dialogContent').dialog('option', 'buttons',
                {
                    "OK": function () { __doPostBack(uniqueID, ''); $(this).dialog("close"); },
                    "Cancel": function () { $(this).dialog("close"); }
                });

            $('#dialogContent').dialog('open');

            return false;
        }

    </script>
    <div id="header">
        <div id="section">
            <table width="100%">
                <tr>
                    <td width="25%" align="center" valign="middle">
                        <img src="Images/LogoRCREEE_Transparent.png" width="200px"/>
                    </td>
                    <td width="50%"  align="center">
                        <asp:Label ID="lbl_header_center" runat="server" Text="دليل إمكانيات الدول العربية<br/>في<br />مجالات الطاقة المتجددة و رفع كفاءة إنتاج و إستهلاك الطاقة"
                            Font-Bold="True" Font-Size="X-Large" Style="font-weight: bolder; color: #FFFFFF;
                            font-size: x-large; width: 100%; text-align: center;" meta:resourcekey="lbl_header_centerResource1">
                        </asp:Label>
                    </td>
                    <td width="25%" align="center" valign="middle">
                        <img src="Images/las-logo.png" width="100px" />
                    </td>
                </tr>
            </table>
        </div>
        <ul>
            <li><a href="Default.aspx">Home</a></li>
            <li><a href="Index.aspx">Index</a></li>
            <li><a href="Topics.aspx">Topics</a></li>
            <li><a href="CountrySelector.aspx">Countries</a></li>
            <li><a href="Aboutus.aspx">About Us</a></li>
            <li><a href="contactus.aspx">Contact us</a></li>
        </ul>
    </div>
</asp:Content>
